<template>
	<view class="container">
		<uni-section title="姓名" sub-title="" type="square">
			<view class="">{{data.name}}</view>
		</uni-section>
		<uni-section title="登录密码" sub-title="" type="square">
			<view class="">{{data.password}}</view>
		</uni-section>
		<uni-section title="学院" sub-title="" type="square">
			<view class="">{{data.department}}</view>
		</uni-section>
		<uni-section title="专业" sub-title="" type="square">
			<view class="">{{data.major}}</view>
		</uni-section>
		<uni-section title="电话" sub-title="" type="square">
			<view class="">{{data.telephone}}</view>
		</uni-section>
		<uni-section title="邮箱" sub-title="" type="square">
			<view class="">{{data.email}}</view>
		</uni-section>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: {
					"id": 3,
					"name": "张三",
					"password": "123",
					"email": "san@qq.com",
					"telephone": "14567345980",
					"department": "信息工程学院",
					"major": "移动应用开发"
				},
			}
		},
		methods: {

		},
		onLoad(opt) {
			console.log(opt);
			uni.request({
				url: 'http://localhost:8090/freshmenapp/classmate/findone',
				method: 'POST',
				data: {
					"id": opt.id
				},
				success: res => {
					console.log(res);
					if (res.data.success) {
						this.data = res.data.data
						uni.showToast({
							title: '成功',
							icon: 'none'
						})
					} else {
						uni.showToast({
							title: '失败',
							icon: 'none'
						})
					}
				},
				fail: () => {
					uni.showToast({
						title: '网络错误',
						icon: 'none'
					})
				},
				complete: () => {}
			});
		}
	}
</script>

<style>
.container {
		padding: 10px;
		font-size: 14px;
		line-height: 24px;
	}
</style>